HTML (Un)Compress Contents.

 HTML (Un)Compress

With the HTML (Un)Compress tool, you can easily compress your HTML files resulting in shorter downloading time. Your pages will appear in exactly the same way in your browser, but they will be about 20% smaller. Afterwards, you can uncompress your files to enable editing once again. When you uncompress, the files will automatically be perfectly outlined, to make them very structured and easy editable by hand. Editing your files in a WYSIWYG editor (as FrontPage, Netscape Composer) is still possible, as well in compressed as in uncompressed form. Please do tell me what you think about this tool at the following address: Jacobs.Jan@village.uunet.be

Main  What's New?  How does it work?  Command Line  Shareware  Tips  Problems	Interface  How to operate this?  What about Lists?  What about Previewing?  What about Backups?  XML Files  The Options Form


How to operate this

There are a few different ways you can use HTMl (Un)Compress in, they are ranked from beginner to advanced user:

 The normal tab

This is the simplest, it was meant for (un)compressing a single file but can also be used with wildcards to compress all files in one directory and possibly its subdirectories

 The advanced tab

This gives easy access to the most advanced systems of HTML (Un)Compress. It was mainly meant for creating a list of files you want to (un)compress on a regular basis.

 Using the command line

HTML (Un)Compress provides a basic but quite powerful command line interface which was mainly meant to be used in scripts etc.

 By editing configuration and list files

By using your one ways to alter the configuration files and list files, you can do virtually anything, you can build your own interface and use HTML (Un)Compress just as a command line call. This is for fanatics.


Normal Tab

There are two ways you can use the normal files, you can either (un)compress single files or use wildcards:

1/ (Un)Compressing single files

First you have to fill in the input file you want to (un)compress in the inputbox. You can do this either by filling it out by hand or by pressing on the browse button next to it and select the file you want to (un)compress. Next, you have to select an output file you want to be created or overwritten with the (un)compressed version of the input file. Then just press either the compress or the uncompress button to get the job done. If there is a small `+' button on top of (un)compress buttons, than this is the beautify button. Pressing this will first compress and then uncompress. It's visibility can be set in the general tab of the options form.

2/ Use wildcards

You can (un)compress a range of files in one directory by using wildcards. Just type an expression containing wildcards (*, ?) in the inputbox and press either the compress or uncompress button on the right. You can also choose to search all subdirectories of the directory given in the inputbox by checking the subdirectory checkbox in the lower left.

When uncompressing files, you must make sure that were first compressed. If you try to uncompress a file that was not first compressed, you are likely to get incorrect results.

 Example


Example

c:\Internet Homepage\*.htm

All the files in the 'Internet Homepage' directory will be (Un)Compressed.

C:\Internet Homepage\index.htm

C:\internet Homepage\index2.htm

The file index.htm will be compressed to index2.htm


XML Files

In HTML (Un)Compress, XML Files are used in three places: as the options file, as list files and as index file for the backup directory. All these files can be edited manually while the program is not running, otherwise you risk that you're changes will simply be overwritten with the settings that were resident in the program.

When editing XML Files though, you must keep some things in mind. The XML engine that I have build was for use within this program only this means it does not support all XML features and it is very susceptible for errors, so don't make any. XML looks very alike HTML, but does have some changes. So is XML case sensitive, remember this or it simply won't work, and in XML, all tags have ending tags.

I didn't include any DTD files, so you'll have to find out the file type yourself, the easiest way to do that is simply to alter all the options and all the list settings once and then have a look at the files, everything should speak for itself. Also remember that for lists, you're not obliged to use this file format, you can also simply use the File/wildcard expression a line file format.

 What about lists?

 What about backups?

 The Options Form


Advanced Tab

The main idea of the advanced tab is that you build a list of files you want to (un)compress and than (un)compress the whole list of files in one go. You can also use the beautify button in this way. A list can contain three things: files, searches and other lists. You save list and perform other interesting operation on them by pressing the ListManager button.

To add differents items to list:

- Files:

Select one or more file(s) in the box on the upper left and press the Add button or double-clicking it You can also add all the files that are visible in the filebox by pressing the Add-All button.

- Searches:

When adding searches, you add an wildcard-expression to the list. Select a directory and make sure no file is selected. Then choose the filetype for which you wish to search and press the add button.

In the list, an icon of a plus or a minus sign is shown in front of the search. When expanding the plus-sign, the search will be performed and all the files that are found will be shown in the list. You can contract this once again by pressing the minus-sign. You can choose whether a search is automatically expanded in the list by selecting the appropriate options on the general-tab of the options-dialog.

For each search you can choose whether or not to search subdirectories by selecting the search in the listbox and then (un)checking the subdir-checkbox in the lower left.

- Lists:

When adding a list to a list, this file will be opened when starting the (un)compress process and all files, searches and lists in that list will also be (un)compressed. In this manner, you can add a whole tree of lists to be processed. Set the filetype to 'List Files (*.lst)', and then add the list as a file. A list-icon should appear in front of it.

 What about lists?

 The ListManager


What about previewing?

In HTML (Un)Compress, you can preview the files you want to (un)compress or that you just have (un)compressed. This can be done by selecting one of the arrows on the upper right of the main form and then clicking on the file you want to preview. This can be don on either the input or the output box of the normal tab, a file in filebox on the upper left of the Advanced tab or a file in the listbox on the bottom of the Advanced tab.

When clicking such a file, the respective browser you selected in the upper right or the source preview window will appear containing the file you wished to preview. The browsers that are shown on the upper right, were searched for on your system the first time you started HTML (Un)Compress. If you want to alter the list of available browsers, this can be done on the previewing tab of the Options form.

The following browsers will be searched for on your system. I included all browsers I use, if you use another one, you'll have to add it yourself. I'm not intending to include other browsers in the next version, but if you send me nice icons and settings, I'll be happy to display it on my internet page.

	Sun's HotJava
	Microsoft Internet Explorer
	Netscape Navigator
	Opera
	Source Preview (build in)

 The Previewing tab of the options form


What about lists?

HTML (Un)Compress currentlysupports two list file formats. First of all the type used before version 5.0, a file containing a filename or a wildcard expression a line. From version 5.0, the standard list type is an XML file which contains two major parts: an Information part and a list of files, searches and lists.

These lists can be used in three different ways: they can be opened in the advanced tab by, using the ListManager, AutoLoading them using the General tab from the Options Form or by using the CommandLine. The main place for altering Lists is the ListManager. One can even include special option settings in the list.

In a list, several icons can appear:

	This can appear only next to searches. Pressing this will show all the files found by this search in the list. One choose to have the searches expand automatically by setting the appropriate option in the general tab of the Options Form.
	This can appear only next to searches. Pressing this will hide files that were found by this search.
	This appears in front of a list that is added to the list.
	This appears in front of files that were changed since the last action on this list if the appropriate option was set in the ListManager. These are the files that will be (un)compressed.

If you encounter speed problems with large lists, have a look at:

 List speed issues

 The ListManager

 The Advanced tab

 The General tab from the Options Form

 XML Files


List speed issues

When using lists with several thousands of elements, you can encounter several performance problems, esspeacially when loading them and when switching between the main form and the ListManager. There is a simple method to avoid this: go through the slow process once, add all files to a list and then save it. Then begin a new list and add the first, big list to it as a single element, by setting the filetype to List Files (*.lst), browsing to the list file and adding it. This way, the large list will only be opened when starting the actual (un)compress process. The options etc. must then be set in the list that obnly contains the reference to the large list.

 What about lists?

 XML Files

 The ListManager

 The Advanced tab


The ListManager

The ListManager is there to load list from and save lists to the disk. But, apart from that, it can do a lot of other things with lists.

1/ Save and Open

By using the Save and open button, you can simply open and save list files to disk. You can only save files in the XML-List format, but open them as well in the XML format as in the file/wildcard a line format.

2/ Options

- Only (un)compress changed files since last action

When checking this option, HTML (Un)Compress will compare the last changed date from all the files in the list with the date and time the last action on this list was performed. A file will only be (un)compressed when he was changed since that last action, or when action you want to perform now is the counterpart of the previously performed action.

- Save changes to list automatically

This will save all changes you make to this list automatically. This option only becomes available when have allready once saved this list.

- Mount to an output directory

This way, you can save the output of a list in another directory in the output. When you for example choose 'c:\temp\' as your input directory and 'c:\tmp\' as the output directory, all the files from the temp directory will be saved in the tmp directory. Please note that by defining 'c:\temp' without the ending '\', all directory names beginning with 'c:\temp' will be accepted. Files that do not fall within these premises, will not be (un)compressed.

3/ Advanced

- List specific options

By checking 'Use list specific options', you can choose to use the options that were included in the list rather than the options specified in the Options Form called from the main window. This option will only be possible when list specific options were specified by using 'Set list specific options'. These options can be remove from the list file by choosing 'Remove Options'.

- Merge with other List

This way, you can add all the items of another list to this list. All the information, options etc. from the other list will be discarded.

- Remove non-existing files

This will remove all the files from the list that could not be found on the system.

- Refresh List

This will update the dates and thus the possible checks in front of all the files in the list.

4/ LastAction

Here you can see some information about the last action that was performed on this list.

 What about lists?

 XML Files

 List speed issues

 The Advanced tab

 The General tab from the Options Form


Options Tab

The Options Form

With the Options form  you can set some options so you can customize HTML (Un)Compress to your own taste. All the options you set here will be saved in the respective options file you're working in. Normally this will simply be the Options.XML file, but you can also be working within a list file when using the 'Set specific options' item on the ListManager or finally, you can have started the program with the '/o' option on the commandline.

The Options Form is devided in the following tabs:

 The General tab

 The Previewing tab

 The File Types tab

 The Backup tab

 The Compress tab

 The UnCompress tab

 The Tag specific tab


The General tab

In the general tab, you can set the following options:

 Animate when switching tabs

 Use AutoComplete checkbox

 Load List on Startup

 Automatically expand searches

 Enable Right-Click shell extension

 What about lists?

 XML Files

 The Normal tab


Animate when switching tabs

By using the Animate when switching tabs checkbox, you can select whether you want the form to change its size when switching between the Normal tab and the two others. It's mainly useful when you have a rather small monitor and resolution. On other computers, it makes less sense.


AutoComplete checkbox

By using the Use AutoComplete checkbox, you can select whether you want to have AutoComplete when you are typing in the files by hand in the Normal tab. You don't have to take any notice of it, you can simply continue typing, but it can be useful. There are two ways AutoComplete is used:

1.	To append towards an element of the previous used list

1.	To add `*.htm' when typing `\'


Load List on Startup

By using the Load List on Startup checkbox, you can select you want to automatically load a list in the list on the Advanced tab at startup or not. You can select which list to load by using the browse button next to the textbox, or by simply typing in the name of the file by hand.


Auto Expand searches

When using this option, all the items found by a search will automatically be added to a list when the search is added to the list. As such, a minus sign will automatically appear in front of it, it is of course not certain that items will also be found.

 What about lists?


Enable right-click shell extension

This option will add a HTML (Un)Compress option to the HMTL-files will clcking them with the right mouse button in the Windows Explorer.


The Previewing tab

On the Previewing tab, you can select the browsers on your system that you want to use for previewing on your system. The first time you start the program, the browsers on your system will be searched, these should now be visible in the left listbox. Select a browser to see the different options that are set.

-	Clicking the 'Edit Browser' button will show the Edit Browser Dialog for the browser that was currently selected.

-	Clicking the 'Remove Browser' button will remove the currently selected browser from the list.

-	Clicking the 'Add Browser' button will allow you to add a browser to the list.

-	Clicking the 'Search Browsers' button will once again search your system for browsers.

 What about previewing?


The File type tab

Here you can select which filetypes you want to be displayed in the filetypes combobox on the Advanced tab of the main form. You can select one of the file types in the list on the left and then alter its information on the right. By checking or unchecking the file type in the list, you can decide whether or not to display the file type in the list on the advanced tab of the main form.

By clicking the 'Add Filetype' button, you can insert a new file type in the list. By clicking the 'Remove Filetype' button, the file type that was selected in the list will be removed. Please note that the 'HTML Files (*.htm;*.html)', 'List Files (*.lst)' and 'All Files (*.*)' file types cannot be removed. If you want to change the order in which the file types appear in the list, you will have to change their order in the Options file Options.XML or whatever options file you are working in at the moment.

 The Advanced tab

 XML Files


What about backups?

HTML (Un)Compress gives you two ways of backing up the files you (un)compress. First of all, you have to choose what you want to backup: Individual files and/or Searches and lists. Then you can choose between the two ways: either by using Bak-files or by using a single directory.

When you choose to use Bak-Files, every file you (un)compress will first be copied to the same filename plus '.bak'. When you choose to use one directory, all the files you want to (un)compress will be copied to a single directory. An index file (Backup.XML) in this directory will keep track of the files that were backed up. But pay attention, all files in this directory that were not placed there by HTML (Un)Compress will be deleted! When you want to restore these files, you can use the dialog that is available from Backup tab from the Options Form.

Please note that using a backup system decreases the speed of the program.

 The Backup tab of the Options Form


The Backup tab

Here you can customize the backup system. This can be done in the global Options file or in individual list files. You can choose which files you want to backup by selecting Individual Files or Searches and Lists.

1/ Use BAK extension

All files will be copied to the same filename plus the '.Bak' extension before (un)compressing.

2/ Use One Directory

Select the directory you want to use as backup directory by filling out the box manually or using the browse button next to it. You can view which files were backed up in this directory and restore or delete them by pressing the 'View backup list'.

You can limit the amount of space that is used by he backup directory by checking 'Limit the amount of space used by backups' and filling out a certain amount in the Textbox.

When you choose to 'Make different backups of one file', different versions, different dates of one file will all be put in the backup directory without deleting the older version.

 What about backups?


The UnCompress tab

Here you can set the following options:

 Divide long lines in smaller parts

 Insert Indents


Divide long lines in smaller parts

By using Divide long lines in smaller parts, you can select whether you want long lines of continues text to be uncompressed in one line or in more lines. You can set the amount of characters after witch a carriage return is inserted by typing in the amount you beneath the checkbox.


Insert Indents

You can select whether or not you want to use hanging indents in your UnCompressed files, and what you exactly want them to be: a tab or a space. You can customize the number of spaces inserted by filling in a number between 1 and 16 the box after spaces.


The Compress tab

Here you can set the following options:

 Remove Comments

 Compress Scripts

 Remove quotes

 Remove Empty and Redundant tags


Remove Comments

You can select whether or not you want to remove the comments in your HTML file when compressing. This includes HTML comments (<!-- -->), Javascript comments (// and /* */) and VB-Script comments (` )


Compress Scripts

You can select whether or not you want to compress the scripts in your HTML files. This includes the Javascripts as well as the VB-Scripts. When selecting this, the scripts are compressed very thoroughly, if there is any problem with the scripts after compressing, don't use this options. Problems could occur when you use object or variable names that begin or end with something else than a letter (a-z, A-Z) or a number (0-9).


Remove Quotes

Remove unnecessary quotes

When using this option, all unneacesary quotes will be removed from the compressed file. Some HTML checkers like HTML Validator see this as an error, but it's not. It can be safely used.


Remove empty and redundant tags

When using this system a lot of empty and redundant tags will be removed. This system is really still in a development phase and using it is strongly discouraged as it still contains several errors and has some basic impossibilities to certify correct results.

 Problems with the removal of empty and redundant tags


Problems with the removal of empty and redundant tags

There are two types of problems with the removal of empty and redundant tags. First of all there are these that I haven't implemented yet, don't do too difficult, it's extremely complex. But apart from that, there are also some basic problems which can't be avoided. For example:

This	Renders like
<A HREF=link1><FONT color=red> Link </FONT></A><BR> <A HREF=link1><FONT color=red> Link </FONT></A>	Link Link
But this	Renders like
<A HREF=link1><FONT color=red> Link </A><BR> <A HREF=link1> Link </FONT></A>	Link Link

And frankly, I can't think of a way to avoid that problem.

 Remove empty and redundant tags


The Tag specific tab

Here you can set options for each tag specifically. You can add tags to delete tags from the list on the left by respectively push the `Add tag' and enter a name or push `Delete tag'. By selecting on of the tags from the list on the left, you can see and change it's specific settings.

One can alter the name of a tag by clicking on the button on the right of the `Tag name' box. When selecting the `Don't change contents' option, neither when compressing neither when uncompressing, the contents of these tags will be altered. The tags will be deleted when compressing and you selected `Remove tag', this is the only rule that can overrule the `Don't touch option'. And finally, when selecting one of the four insert line options, when uncompressing an empty line will be inserted in it's respective position.

 The Compress tab

 The UnCompress tab


What's new in version 5.1?

- Enormous speed improvement on large files

- Tag specific options

- Empty line insertion when uncompressing

- Beautify button

- various bug fixes

 Additions in previous versions


Previous additions

What's new in version 5.0?

- Extended List capabilities, the ListManager

- Backup facilities

- Previewing facilities

- Empty and redundant tag removal

- XML files

- A New Options form

What's new in version 4.2?

- Finally! You can pay with Credit Cards etc. Online, through TUCOWS' E-Barn

- You can select how many spaces to insert when uncompressing.

- A lot of bugs have been fixed since the first Delphi version.

What's new in version 4.1?

- It's completely rebuild from scratch

- No runtime libraries are needed anymore, it's now Delphi.

- It should contain less errors

- The UnCompress engine is now very fast

- UnCompress now happens without erroneous space insertion

- Explorer Extentions

- It has a new icon

What's new in version 4.0?

- A new help system (guess what you're looking at)

- Better Compression of styles and scripts

- Better UnCompression of styles and scripts

- New compression techniques

- You can now use lists within lists

What's new in version 3.1?

- Very FAST and better new compressor

- Support to compress VRML

What's new in version 3.0?

- The advanced tab

- Ability to (Un)Compress files from totally different locations

- Open and Save lists of files to (Un)Compress

- Full OLE-Drag support from Windows Explorer

- Options Tab

- Control Animation and AutoCompletion

- Customize UnCompress Settings

- Support for International HTML-Pages

- Channel Description File Support

What's new in version 2.0?

- Using wildcards directly from within the tool

- Splitting up long lines of text by uncompressing

- Better compression of the < pre> tag

- Autocompletion and previously compressed files list

- Updated interface

- Compatibility with VBScript

- Uncompressing with automatic outlining of:VBScript, Styles

- This is now a Shareware version


Command Line parameters

You can also use the HTML (Un)Compress tool with the Command Line. This is very useful for peoples who want to process large numbers of files. This is how you do it:

HTMLComp [/y] [/s] [/l] [/c] [/u] file1.htm[file2.htm]

/y	There are no questions asked, everything is automatically answered yes and the program will be automatically shut down after the process.
/s	Use this option to scan the subdirectories for files to compress according the wildcards of file1.htm
/l	File1 is list file (file1.lst), this list file can contain references to other lists
/c	Use this option to compress.
/u	Use this option to uncompress.
file1.htm	Needed. This file will be used as input. May contain wildcards but then the file2.htm tag will be ignored.
file2.htm	Needed. This file will be used as output.


How does it work?

The Compress tool removes all information used for editing in the HTML file. This information is unneeded for viewing the HTML file but is simply used to make its editing a lot easier. The UnCompress function of this tool though adds this formatting information once again by using the common standards of HTML files like indents etc.

For example:

Normal uncompressed:

<html><head>

<title>

Test page</title>

</Head>

<body>

<H1>

Test page

</h1></body>

</html>

Compressed:

<html><head><title>Test page</title></Head><body><H1>Test page</h1></body></html>

UnCompressed:

<HTML>

<HEAD>

<TITLE>

Test page

</TITLE>

</HEAD>

<BODY>

<H1>

Test page

</H1>

</BODY>

</HTML>


Shareware

This program is shareware. This means you can only use it for 30 days, after this period you have to register or you'll not be able to(Un)compress anymore. The registration fee is 20$ or 25$ if you want to pay with credit cards etc. You can either pay directly with the author, or you can pay through E-Barn, an internet shop from TUCOWS. For more information about registering the HTML (Un)Compress tool, follow the instructions on the startup screen. Once you have registered, this screen will no longer appear and you will be able to use the tool longer than 30 days.

International prices: $20(US), 35DM, 15£, 40HFl, 700BF or about the same amount in no matter what currency. (Only for payment directly with the author)


Tips

-	You can create a very easy system for (un)compressing vast amounts of files by using lists and lists within list. Scripts can also create the lists.

-	You can use this tool to make your file look a lot nicer in a plain text editor by first compressing and then uncompressing your file, the outlining will be done, the formatting string will be made capitals and so on

-	It can be useful to keep the source of your files apart in for example an Index.src.html Especially when you are compressing files with Java-Scripts. If you loose this program or a program error damages your file, you still have the source files.

-	Check out the online information at:

http://gallery.uunet.be/Jacobs.Jan/htmlcomp/index.htm

-	If you encounter any problem at all you can always contact me.

 List speed issues


Problems

If you have a problem using this tool or if a(n) (Un)Compressed file does not work correctly anymore, send me a description of the problem and the source HTML file to the following address:

Jacobs.Jan@village.uunet.be

If you have a problem with scripts, please deselect the compress scripts option on the Options-Tab.

 List speed issues